#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail

STARTUP_DIR="$( cd "$( dirname "$0" )" && pwd )"

source ${STARTUP_DIR}/../settings.sh
SELDON_CORE_DIR=${STARTUP_DIR}/../../..

KUBECTL="kubectl --context=${KUBE_CONTEXT}"

# add seldon crd access to admin role
 ${KUBECTL} apply -f ${STARTUP_DIR}/seldon-aggregate-to-admin.json

helm install --kube-context="${KUBE_CONTEXT}" ${SELDON_CORE_DIR}/helm-charts/seldon-core-operator --name seldon-core --set usageMetrics.enabled=true --namespace seldon-system
helm install --kube-context="${KUBE_CONTEXT}" stable/ambassador --name ambassador --namespace default --set crds.keep=false --set replicaCount=1

